#ifndef __OAL_LOG_H__
#define __OAL_LOG_H__

#include <report.h>
#include <oal_types.h>


#define OAL_LOG_MAX_LEN 1024

#define OAL_LOG_FATAL	100
#define OAL_LOG_ERROR   80
#define OAL_LOG_WARN    60
#define OAL_LOG_INFO    40
#define OAL_LOG_DEBUG   20




OAL_DECL(int) oal_log_init(void);

OAL_DECL(int) oal_log_write(const char *flie,int line,int level,fmt,...);

OAL_DECL(void) oal_log_set_level(int level);

OAL_DECL(void) oal_log_stdout_enable(void);

#define OLOG_FATAL(fmt,args...) \
	oal_log_write(__FILE__,__LINE__,OAL_LOG_FATAL,fmt,##args)
#define OLOG_ERROR(fmt,args...) \
	oal_log_write(__FILE__,__LINE__,OAL_LOG_ERROR,fmt,##args)
#define OLOG_WARN(fmt,args...) \
	oal_log_write(__FILE__,__LINE__,OAL_LOG_WARN,fmt,##args)
#define OLOG_INFO(fmt,args...) \
	oal_log_write(__FILE__,__LINE__,OAL_LOG_INFO,fmt,##args)
#define OLOG_DEBUG(fmt,args...) \
	oal_log_write(__FILE__,__LINE__,OAL_LOG_DEBUG,fmt,##args)




#endif